package com.neutech.solar.entity;

import com.neutech.solar.constant.Constant;
import com.neutech.solar.util.ImageUtil;

import java.awt.*;

public class Sun extends Star{
    public Sun(String path) {
        this();
        this.img = ImageUtil.getImage(path);
    }

    public Sun() {
        this.img = ImageUtil.getImage("火星.png");
        this.width = img.getWidth(null);
        this.height = img.getHeight(null);
        this.x = Constant.WINDOW_WIDTH / 2 - width / 2 ;
        this.y = Constant.WINDOW_HEIGHT / 2 - height / 2;
    }

    @Override
    public void draw(Graphics g) {
        g.drawImage(img,x,y,null);
    }


}
